package com.hongyi.system.controller;

import cn.dev33.satoken.annotation.SaCheckPermission;
import com.github.xiaoymin.knife4j.annotations.ApiSort;

import com.hongyi.common.framework.domain.JsonResult;
import com.hongyi.common.framework.domain.Server;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 服务器监控
 *
 * @author DingHao
 */
@ApiSort(value = 15)
@Api(tags = "服务器监控控制器")
@RestController
@RequestMapping(value = "/monitor", produces = MediaType.APPLICATION_JSON_VALUE)
public class ServerController {

    @ApiOperation(value = "服务器信息")
    @SaCheckPermission("system:server:list")
    @GetMapping(value = "/server")
    public JsonResult<Server> getInfo() throws Exception {
        Server server = new Server();
        server.copyTo();
        return JsonResult.ok(server);
    }
}
